package com.twang.stock.controller.common;

import com.twang.stock.entity.ex.KaiPanLaBanKuaiEx;
import com.twang.stock.entity.ex.StockWarningEventEx;
import com.twang.stock.service.StockWarningEventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping(value = "/kpl")
@Slf4j
public class KaiPanLaController {

    @Autowired
    private StockWarningEventService stockWarningEventService;


    @RequestMapping(value = "/yuJing")
    public ModelAndView yuJing() {
        ModelAndView modelAndView = new ModelAndView();
        List<StockWarningEventEx> stockWarningEventExes = stockWarningEventService.queryYuJing();
        modelAndView.addObject("stockWarningEvent", stockWarningEventExes);
        modelAndView.setViewName("yuJingList");
        return modelAndView;
    }

    @RequestMapping(value = "/bankuai")
    public ModelAndView bankuai() {
        ModelAndView modelAndView = new ModelAndView();
        List<KaiPanLaBanKuaiEx> kaiPanLaBanKuais = stockWarningEventService.queryYuJingBanKuai();
        modelAndView.addObject("kaiPanLaBanKuais", kaiPanLaBanKuais);
        modelAndView.setViewName("yuJingBanKuaiList");
        return modelAndView;
    }





}
